/**
 * This source code is licensed under the terms of the
 * GNU Affero General Public License found in the LICENSE file in
 * the root directory of this source tree.
 *
 * Copyright (c) 2021-present Kaleidos INC
 */
import { bootstrapApplication } from '@angular/platform-browser';
import { provideRouter } from '@angular/router';
import { routes } from './app/app-routing.module';
import { provideHttpClient } from '@angular/common/http';
//import { provideStore } from '@ngrx/store';
//import { provideEffects } from '@ngrx/effects';
//import { TranslateService } from '@ngx-translate/core';
//import { provideAppInitializer, inject } from '@angular/core';
//import { ConfigService } from './app/config.service';
import { AppComponent } from './app/app.component';
import { importProvidersFrom } from '@angular/core';
import { TranslateModule } from '@ngx-translate/core';

console.log('Routes:', routes);

bootstrapApplication(AppComponent, {
  providers: [
    provideRouter(routes),
    provideHttpClient(),
    // provideStore({}),
    // provideEffects([]),
    importProvidersFrom(TranslateModule.forRoot()),
    // provideAppInitializer(
    //   () => {
    //     const appConfigService = inject(ConfigService);
    //     const translate = inject(TranslateService);
      
    //     return appConfigService.fetch().then(config => {
    //       translate.setDefaultLang(config.defaultLanguage);
    //       translate.use(config.defaultLanguage);
    //     });      
    // },
    // ),
  ],
});
